﻿using System;
using System.Text;
using System.Data;
using System.Data.OleDb;
using System.Collections.Generic;
using System.Reflection;
namespace BLL
{
	 	//Newscont
		public static class LotteryBuyDetail
	{
            private static Data.LotteryBuyDetail Data_Newscont = new Data.LotteryBuyDetail();	
		
		/// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static long Add(Model.LotteryBuyDetail model)
        {
              return Data_Newscont.Add(model);
        }
         /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static int Update(Model.LotteryBuyDetail model)
        {
            return Data_Newscont.Update(model);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static bool Delete(long Id)
        {
            return Data_Newscont.Delete(Id);
        }       
        /// <summary>
        /// 单条
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static Model.LotteryBuyDetail GetModel(long Id)
        {
             return Data_Newscont.GetModel(Id);
        }
        /// <summary>
        /// 上一篇
        /// </summary>
        /// <param name="IndexID"></param>
        /// <param name="tName"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        public static Model.LotteryBuyDetail Prv(long IndexID, string condition)
        {
            string sql = "";
            if (condition == "")
            {

                sql = "SELECT top 1  * FROM LotteryBuyDetail WHERE Id <" + IndexID + " ORDER BY Id DESC";
            }
            else
            {
                sql = "select top 1 * from LotteryBuyDetail where Id<" + IndexID + " and " + condition + " order by Id desc";
            }

            return Data_Newscont.GetModelBysql(sql);

        }
        public static Model.LotteryBuyDetail NewsTopOne(string sql)
        {
            return Data_Newscont.GetModelBysql(sql);

        }
        /// <summary>
        /// 下一篇
        /// </summary>
        /// <param name="IndexID"></param>
        /// <param name="tName"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        public static Model.LotteryBuyDetail Next(long IndexID, string condition)
        {
            string sql = "";
            if (condition == "")
            {
                sql = "SELECT top 1 * FROM LotteryBuyDetail WHERE Id >" + IndexID + " ORDER BY Id asc";
            }
            else
            {
                sql = "select top 1 * from LotteryBuyDetail where Id>" + IndexID + " and " + condition + " order by Id desc";
            }
            return Data_Newscont.GetModelBysql(sql);

        }
        /// <summary>
        /// 总数据数
        /// </summary>
        /// <returns></returns>
        public static int GetAll_Count()
        {
            return Data_Newscont.GetAll_Count();
        }        
        /// <summary>
        /// 抽取分页数据
        /// </summary>
     
        public static List<Model.LotteryBuyDetail> GetIsWin(int pageIndex, int pageSize, int type, out int totalCount)
        {
            return Data_Newscont.GetIsWin(pageIndex, pageSize, type, out totalCount);
        }
        public static List<Model.LotteryBuyDetail> GetWinUserListByWhere(int pageIndex, int pageSize, int lotteryType, string lotteryQs, out int totalCount)
        {
            return Data_Newscont.GetWinUserListByWhere(pageIndex, pageSize, lotteryType, lotteryQs, out totalCount);
        }
        public static List<Model.LotteryBuyDetail> getlistbytypeandqs(int pageIndex, int pageSize, int lotteryType, string lotteryQs, out int totalCount)
        {
            return Data_Newscont.getlistbytypeandqs(pageIndex, pageSize, lotteryType, lotteryQs, out totalCount);
        }
        public static List<Model.LotteryBuyDetail> GetPageListWhere(int pageIndex, int pageSize, string lotteryQs, int lotteryType, out int totalCount)
        {
            return Data_Newscont.GetPageListWhere(pageIndex, pageSize, lotteryQs,lotteryType, out totalCount);
        }
        public static List<Model.LotteryBuyDetail> GetPageListBysql(int pageIndex, int pageSize,string sql, out int totalCount)
        {
            return Data_Newscont.GetPageListBysql(pageIndex, pageSize, sql, out totalCount);
        }
        public static DataTable GetPageDT_Where(int PageIndex, int PageSize, long newsclassid, out int totalCount)
        {
            return Data_Newscont.GetPageDT_Where(PageIndex, PageSize, newsclassid, out totalCount);
        }
        public static DataTable GetPageDTWhere(int PageIndex, int PageSize, int lotteryType, string lotteryQs, out int totalCount)
        {
            return Data_Newscont.GetPageDTWhere(PageIndex, PageSize, lotteryType, lotteryQs, out totalCount);
        }
       
        /// <summary>
        /// 批删
        /// </summary>
        /// <param name="Ids"></param>
        /// <returns></returns>
        public static int Drop(string Ids)
        {
            return Data_Newscont.Drop(Ids);
        }
    //--------------------------------------------------------------------------    
        public static DataTable GetPageListBysql(string sql)
        {
            return Data_Newscont.GetPageListBysql(sql);
        }
        
        public static List<Model.LotteryBuyDetail> GetPageList_Where(int pageIndex, int pageSize, long newsclassid, out int totalCount)
        {
            return Data_Newscont.GetPageList_Where(pageIndex, pageSize, newsclassid, out totalCount);
        }
    }
}